#ifndef _DEBUG_H
#define _DEBUG_H

#include "config.h"

#define __ERROR_MSG(a, x...) do{fprintf(stderr, "Error:%s %s %d : "a, \
        __FILE__, __FUNCTION__, __LINE__, ##x);} \
        while(0)

#define __DEBUG_MSG(a, x...) do{printf("Debug:%s %s %d : "a, \
        __FILE__, __FUNCTION__, __LINE__, ##x);} \
        while(0)

#ifdef ENABLE_GUI_DEBUG
  #define __GUI_DEBUG(a, x...) do{fprintf(stderr, "Gui debug:%s %s %d : "a, \
        __FILE__, __FUNCTION__, __LINE__, ##x);} \
        while(0)
#else
  #define __GUI_DEBUG(a, x...)
#endif


#ifdef ENABLE_XML_DEBUG
  #define __XML_DEBUG(a, x...) do{fprintf(stderr, "Xml debug:%s %s %d : "a, \
        __FILE__, __FUNCTION__, __LINE__, ##x);} \
        while(0)
#else
  #define __XML_DEBUG(a, x...)
#endif


#ifdef ENABLE_MONITOR_DEBUG
  #define __MONITOR_DEBUG(a, x...) do{fprintf(stderr, "Monitor debug:%s %s %d : "a, \
        __FILE__, __FUNCTION__, __LINE__, ##x);} \
        while(0)
#else
  #define __MONITOR_DEBUG(a, x...)
#endif


#ifdef ENABLE_RULES_DEBUG
  #define __RULES_DEBUG(a, x...) do{fprintf(stderr, "Rules debug:%s %s %d : "a, \
        __FILE__, __FUNCTION__, __LINE__, ##x);} \
        while(0)
#else
  #define __RULES_DEBUG(a, x...)
#endif

#define _SUCCESS 	0
#define _FAILED		-1 

#endif
